package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.CategoryDTO;
import com.sky.entity.Category;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CategoryMapper {

    @AutoFill(OperationType.INSERT)
    void addCategory(Category category);

    Page pageQuery(CategoryMapper categoryMapper);

    List<Category> getCategoryByType(Integer type);

    @Select("select category.name from category where  id = #{id}")
    String getNameById(Long categoryId);
}
